package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.WaitlistMapper;
import com.ruoyi.business.domain.Waitlist;
import com.ruoyi.business.service.IWaitlistService;

/**
 * 候补订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-24
 */
@Service
public class WaitlistServiceImpl implements IWaitlistService 
{
    @Autowired
    private WaitlistMapper waitlistMapper;

    /**
     * 查询候补订单
     * 
     * @param id 候补订单主键
     * @return 候补订单
     */
    @Override
    public Waitlist selectWaitlistById(Long id)
    {
        return waitlistMapper.selectWaitlistById(id);
    }

    /**
     * 查询候补订单列表
     * 
     * @param waitlist 候补订单
     * @return 候补订单
     */
    @Override
    public List<Waitlist> selectWaitlistList(Waitlist waitlist)
    {
        return waitlistMapper.selectWaitlistList(waitlist);
    }

    /**
     * 新增候补订单
     * 
     * @param waitlist 候补订单
     * @return 结果
     */
    @Override
    public int insertWaitlist(Waitlist waitlist)
    {
        waitlist.setCreateTime(DateUtils.getNowDate());
        return waitlistMapper.insertWaitlist(waitlist);
    }

    /**
     * 修改候补订单
     * 
     * @param waitlist 候补订单
     * @return 结果
     */
    @Override
    public int updateWaitlist(Waitlist waitlist)
    {
        return waitlistMapper.updateWaitlist(waitlist);
    }

    /**
     * 批量删除候补订单
     * 
     * @param ids 需要删除的候补订单主键
     * @return 结果
     */
    @Override
    public int deleteWaitlistByIds(Long[] ids)
    {
        return waitlistMapper.deleteWaitlistByIds(ids);
    }

    /**
     * 删除候补订单信息
     * 
     * @param id 候补订单主键
     * @return 结果
     */
    @Override
    public int deleteWaitlistById(Long id)
    {
        return waitlistMapper.deleteWaitlistById(id);
    }
}
